package com.atguigu.day09;

public class Test16 {
    public static void main(String[] args) {
        Employee e = new Employee(01,"张三",25,15000);
        Programmer p= new Programmer(e,"Python");
        Designer d = new Designer(p,"Python",15000);
        Architect a = new Architect(d,"Python",15000,2000);
        System.out.println(e.getInfo());
        System.out.println(p.getInfo());
        System.out.println(d.getInfo());

        System.out.println(a.getInfo());
    }

}
class Employee{

    private int id;
    private String name;
    private int age;
    private double salary;

    public Employee() {

    }

    public Employee(int id, String name, int age, double salary) {
        this.id = id;
        this.name = name;
        this.age = age;
        this.salary = salary;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }
    public String getInfo(){
        return "编号:"+id+",姓名:"+name+",年龄:"+age+",薪资:"+salary;
    }
}
class Programmer extends Employee{
    public Programmer(Employee employee, String useLanguage) {
        super(employee.getId(), employee.getName(), employee.getAge(), employee.getSalary());
        this.useLanguage = useLanguage;
    }

    private String useLanguage = "java";

    public Programmer() {
    }

    public Programmer(String useLanguage) {
        this.useLanguage = useLanguage;
    }

    public String getUseLanguage() {
        return useLanguage;
    }

    public void setUseLanguage(String useLanguage) {
        this.useLanguage = useLanguage;
    }
    public String getInfo(){
        return super.getInfo()+",编程语言:"+useLanguage;
    }
}
class Designer extends Programmer{
    public Designer(Employee employee, String useLanguage, double bonus) {
        super(employee, useLanguage);
        this.bonus = bonus;
    }

    private double bonus;

    public Designer() {
    }

    public Designer(double bonus) {
        this.bonus = bonus;
    }

    public double getBonus() {
        return bonus;
    }

    public void setBonus(double bonus) {
        this.bonus = bonus;
    }
    public String getInfo(){
        return super.getInfo()+",奖金:"+bonus;
    }
}
class Architect extends Designer{
    public Architect(Employee employee, String useLanguage, double bonus, double stockNums) {
        super(employee, useLanguage, bonus);
        this.stockNums = stockNums;
    }



    private double stockNums;

    public Architect() {
    }

    public Architect(double stockNums) {
        this.stockNums = stockNums;
    }

    public double getStockNums() {
        return stockNums;
    }

    public void setStockNums(double stockNums) {
        this.stockNums = stockNums;
    }
    public String getInfo(){
        return super.getInfo()+",持有股票数量:"+stockNums;
    }
}
